﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace yq.ControllerBase
{
    /// <summary>
    /// 站点配置文件
    /// </summary>
    public class WebConfig : cn.Util.WebConfig
    {
        

        /// <summary>
        /// 是否初始化系统过
        /// </summary>
        private static string _WebId ="";

        public static string WebId
        {
            get { return WebConfig._WebId; }
            set { WebConfig._WebId = value; }
        }

        /// <summary>
        /// 当前版本
        /// </summary>
        public static string Ver
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<string>("Ver");
            }
        }

        /// <summary>
        /// 资源地址
        /// </summary>
        public static string ResPath
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<string>("ResPath");
            }
        }

        /// <summary>
        /// 是否开发模式
        /// </summary>
        public static bool IsDevelop
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<bool>("IsDevelop");
            }
        }

        /// <summary>
        /// 错误页面地址
        /// </summary>
        public static string Error500
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<string>("500");
            }
        }

        /// <summary>
        /// 一次任务执行的数量
        /// </summary>
        public static int RunTaskNum
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<int>("RunTaskNum");
            }
        }

        /// <summary>
        /// 404页面地址
        /// </summary>
        public static string Error404
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<string>("404");
            }
        }

        /// <summary>
        /// 默认控制器
        /// </summary>
        public static string DefaultController
        {
            get
            {
                return cn.Util.WebConfig.AppSetting<string>("DefaultController") ?? "Home";
            }
        }
    }
}
